package com.ruoyi.forest;

import com.dtflys.forest.annotation.*;
import com.ruoyi.app.dto.QrCodeDto;

import java.util.Map;


public interface WeChatClient {

    @GetRequest(url = "https://api.weixin.qq.com/sns/oauth2/access_token?grant_type=authorization_code")
    @LogEnabled(false)
    Map<String,Object> getWxPublicOpenid(@Query("appid") String appid, @Query("secret") String secret, @Query("code") String code);

    @GetRequest(url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential")
    @LogEnabled(false)
    Map<String,Object> getWxToken(@Query("appid") String appid, @Query("secret") String secret);

    @GetRequest(url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket")
    @LogEnabled(false)
    Map<String,Object> getTicket(@Query("access_token") String access_token, @Query("type") String type);

    @GetRequest(url = "https://api.weixin.qq.com/sns/jscode2session?grant_type=authorization_code")
    @LogEnabled(false)
    Map<String,Object> getWxXcxOpenid(@Query("appid") String appid, @Query("secret") String secret, @Query("js_code") String js_code);

    @PostRequest(url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit")
    @LogEnabled(false)
    byte[] getWxQrCode(@Query("access_token") String accessToken, @JSONBody QrCodeDto qrCode);

}
